package com.chexiehui.jc.mvp.home;

import com.chexiehui.jc.Constants;
import com.chexiehui.jc.base.BaseModel;
import com.chexiehui.jc.base.BasePage;
import com.chexiehui.jc.base.BaseView;
import com.chexiehui.jc.entity.CarInfo;
import com.chexiehui.jc.entity.PostInfo;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * @Description 首页新车
 * @Auth SongJun
 * @Date 2019/11/20 10:05
 **/
public interface HomeSlideNewCarCovenant {

    interface View extends BaseView {
        void onGetCarListSuccess(BaseModel<BasePage<CarInfo>> successResult);

        void onGetCarListFailure(BaseModel<Object> failureResult);

        void onGetPostListSuccess(BaseModel<BasePage<PostInfo>> successResult);

        void onGetPostListFailure(BaseModel<Object> failureResult);
    }

    interface Stores {
        @FormUrlEncoded
        @POST(Constants.URL_HOME_NEW_CAR)
        Observable<BaseModel<BasePage<CarInfo>>> getCarList(
                @Field("pageIndex") int pageIndex, @Field("pageSize") int pageSize);

        @FormUrlEncoded
        @POST(Constants.URL_HOME_RECOMMEND_POST)
        Observable<BaseModel<BasePage<PostInfo>>> getPostList(
                @Field("pageIndex") int pageIndex, @Field("pageSize") int pageSize);

    }

    interface Presenter {
        void getCarList();

        void getPostList(int pageNum);

    }

}